<!DOCTYPE html>
<html>
<head>
    <title>Function Example 3</title>
    <script type="text/javascript">
        function diff(num1, num2) {
            if (num1 < num2) {
                return num2 - num1;
            } else {
                return num1 - num2;
            }
        }

        var result = diff(7, 10);
        alert(result);
    </script>
</head>
<body>

</body>
</html>